<?php

namespace Database\Seeders;

use App\Models\AdminMenu;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class AdminMenuSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $data = [
            ['title'=>'平台管理','icon'=>'','name'=>'home','parent'=>0],
            ['title'=>'商品管理','icon'=>'','name'=>'product','parent'=>0],
            ['title'=>'订单管理','icon'=>'','name'=>'order','parent'=>0],

            ['title'=>'横幅管理','icon'=>'','name'=>'banner','parent'=>1],
            ['title'=>'用户管理','icon'=>'','name'=>'user','parent'=>1],

            ['title'=>'商品管理','icon'=>'','name'=>'list','parent'=>2],
            ['title'=>'拍卖列表','icon'=>'','name'=>'auction','parent'=>2],

            ['title'=>'订单管理','icon'=>'','name'=>'list','parent'=>3],

        ];

        DB::table('admin_menus')->truncate();

        collect($data)->each(function ($item){
            AdminMenu::create($item);
        });
    }
}
